package com.duojuhe.coremodule.topo.pojo.dto.elementclass;

import com.duojuhe.common.bean.BaseBean;
import com.duojuhe.common.constant.RegexpConstants;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
public class SaveTopoElementClassReq extends BaseBean {
    @ApiModelProperty(value = "分类名称", required = true)
    @Length(max = 30, message = "分类名称不得超过{max}位字符")
    @NotBlank(message = "分类名称不能为空")
    private String className;

    @ApiModelProperty(value = "是否展开，0=否1=是", required = true)
    @NotNull(message = "是否展开参数不能为空")
    @Range(min = 0, max = 1, message = "是否展开参数值不正确")
    private Integer expandFlag;

    @ApiModelProperty(value = "状态：FORBID禁用 NORMAL正常", example = "1",required=true)
    @Pattern(regexp = RegexpConstants.STATUS, message = "状态参数错误!")
    @NotBlank(message = "状态不能为空")
    private String statusCode;

    @ApiModelProperty(value = "排序，只能为纯数字", example = "1",required=true)
    @NotNull(message = "排序不能为空")
    @Range(min = 1, max = 10000, message = "排序数值不正确")
    private Integer sort;
}